//
//  STESocialNetworkManager.m
//  ste
//
//  Created by iRDC on 6/29/13.
//  Copyright (c) 2013 Lekima. All rights reserved.
//

#import "STESocialNetworkManager.h"
#import "ShareKitDemoConfigurator.h"
#import "SHKConfiguration.h"
#import "SHKSharer.h"
#import "SHKFacebook.h"
@implementation STESocialNetworkManager
static  STESocialNetworkManager* sharedSTESocialNetworkManagerInstance = nil;
+(STESocialNetworkManager*) sharedSTESocialNetworkManager
{
	@synchronized(self)
	{
		if (sharedSTESocialNetworkManagerInstance == nil) {
			sharedSTESocialNetworkManagerInstance = [[STESocialNetworkManager alloc] init];
            DefaultSHKConfigurator *configurator = [[ShareKitDemoConfigurator alloc] init];
            [SHKConfiguration sharedInstanceWithConfigurator:configurator];
		}
	}
    return sharedSTESocialNetworkManagerInstance;
}
- (void) logginFacebook: (id) delegate
{
    
    SHKSharer *service = [[SHKFacebook alloc] init];
    if(![service authorize]) //This will prompt for login if token was not saved or if it got expired.
    {
        service.shareDelegate = delegate; //implement the delegate so that once after login you will get to know when to fetch token.
    }
    else
    {
        //Directly access the token with the key in NSUserdefaults and use this.
    }
}
@end
